package br.com.mtg.movethegarbage.framework;

import java.io.InputStream;
import java.io.OutputStream;
import java.nio.ByteBuffer;
import java.util.ArrayList;

import android.content.Context;
import android.content.res.AssetManager;

public abstract class FileIO
{
	protected AssetManager assetManager;
	protected Context context;

	public FileIO(Context _context)
	{
		context = _context;
		assetManager = context.getAssets();
	}

	public abstract InputStream readAsset(String fileName) throws Exception;

	public abstract InputStream readFile(String fileName) throws Exception;

	public abstract OutputStream writeFile(String fileName, boolean append) throws Exception;

	public abstract boolean checkIfExists(String fileName) throws Exception;

	public abstract String[] listFiles() throws Exception;
	
	public abstract ArrayList<String> readAndFragment(String fileName, int size) throws Exception;
	
	public abstract ByteBuffer mergeParts(ArrayList<String> nameList) throws Exception;
}
